/*
 * @lc app=leetcode.cn id=832 lang=rust
 *
 * [832] 翻转图像
 */

// @lc code=start
impl Solution {
    pub fn flip_and_invert_image(image: Vec<Vec<i32>>) -> Vec<Vec<i32>> {
        let mut image = image;
        for i in 0..image.len() {
            image[i].reverse();
            for j in 0..image[i].len(){
                if image[i][j] == 0{
                    image[i][j] = 1;
                }
                else{
                    image[i][j] = 0;
                }
            }
        }
        return image;
    }
}
// @lc code=end

